
 <form class="form-horizontal"  novalidate role="form" name='myform'>
  <div class="form-ctrl md-whiteframe-z1">
    <div class="form-search"   style="height:270px;"    ng-class="{true: 'shou'}[shoumun==0]"  ng-switch on="param.timeType" >

    <div>
      <label style="">业务线</label>
        <md-select ng-model="failedTrade.businessLine" >
        <md-select-label>
           {{failedTrade.businessLine ? _getNames(failedTrade.businessLine,'businessLineName') : "全部"}}
        </md-select-label>
          <md-option ng-value="" ng-click="getBL()">全部</md-option>
          <md-option ng-value="business"  ng-repeat="business in businessLines" ng-click="getBL(business.businessLineCode)">{{business.businessLineName}}</md-option>
        </md-select>
     </div>



      <div ng-if='conditionSW'>
        <label style="width:70px">接入渠道</label>
        <md-select multiple ng-model="failedTrade.channel"  placeholder="全部"  ng-click="queryChonnel()"  >
            <md-select-label>{{failedTrade.channel.length ? _getNames(failedTrade.channel,'channelName',channels) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'channel')">全部</md-option>
          <md-option ng-value="channel" ng-repeat="channel in channels" >{{channel.channelName}}</md-option>
        </md-select>
      </div>



       <div ng-if='!conditionSW'>
        <label style="width:70px">接入渠道</label>
        <md-select multiple ng-model="failedTrade.channel" disabled placeholder="全部"   >
            <md-select-label>{{failedTrade.channel.length ? _getNames(failedTrade.channel,'channelName',channels) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'channel')">全部</md-option>
          <md-option ng-value="channel" ng-repeat="channel in channels" >{{channel.channelName}}</md-option>
        </md-select>
      </div>

     <div ng-show='disabledSw' >
      <label style="">交易类型</label>
        <md-select multiple ng-model="failedTrade.transaction">
          <md-select-label>{{failedTrade.transaction.length ? _getNames(failedTrade.transaction,'tradeTypeName',transactions) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'transaction')">全部</md-option>
          <md-option ng-value="transaction" ng-repeat="transaction in transactions.getTransactions">{{transaction.tradeTypeName}}</md-option>
        </md-select>
     </div>


    <div ng-show='!disabledSw'>
      <label style="">交易类型</label>
        <md-select  ng-model="failedTrade.transaction"   disabled placeholder="全部" >
    </div>


      <div ng-if='conditionSW'>
        <label style="">机构</label>
        <md-select multiple ng-model="failedTrade.agency" >
          <md-select-label>{{failedTrade.agency.length ? _getNames(failedTrade.agency,'organizationName',agencys) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'agency')">全部</md-option>
          <md-option ng-value="agency" ng-repeat="agency in agencys">{{agency.organizationName}}</md-option>
        </md-select>
      </div>

        <div ng-if='!conditionSW'>
        <label style="">机构</label>
        <md-select multiple ng-model="failedTrade.agency"  disabled>
          <md-select-label>{{failedTrade.agency.length ? _getNames(failedTrade,'agency','organizationName',agencys) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'agency')">全部</md-option>
          <md-option ng-value="agency" ng-repeat="agency in agencys">{{agency.organizationName}}</md-option>
        </md-select>
      </div>

      <div>
        <label style="">省公司</label>
        <md-select multiple ng-model="failedTrade.province">
          <md-select-label>{{failedTrade.province.length ? _getNames(failedTrade.province,'provinceName',provinces) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'province')">全部</md-option>
          <md-option ng-value="province"   ng-repeat="province in provinces">{{province.provinceName}}</md-option>
        </md-select>
      </div>
       <div>
        <md-switch  ng-model="failedTrade.queryType" >
          精确查询
        </md-switch>
      </div>

       <div ng-show='failedTrade.queryType'>
         <md-input-container flex>
           <label style="">返回码</label>
           <input  ng-model='params.returnCode' />
         </md-input-container>
      </div>

      <div ng-show='!failedTrade.queryType'>
        <label style="width:70px">返回码</label>
        <md-select multiple ng-model="failedTrade.returnCode" >
            <md-select-label>{{failedTrade.returnCode.length ? _getNames(failedTrade.returnCode,'returnName',returnCodes) : "全部"}}</md-select-label>
          <md-option ng-value="" ng-click="_checkAll(failedTrade,'returnCode')">全部</md-option>
          <md-option ng-value="returnCode" ng-repeat="returnCode in returnCodes" >{{returnCode.returnName}}</md-option>
        </md-select>
      </div>


      <div>
        <label style="">账期</label>
          <md-select   ng-model="param.timeType" >
          <md-option   ng-value="timeType.timeTypeCode"     ng-repeat="timeType in timeTypes">{{timeType.timeTypeName}}</md-option>
        </md-select>
      </div>

      <!--账期为年-->
      <div  ng-switch-default='5'>
        <md-input-container flex>
            <label >开始时间</label>
            <input type="number" ng-model="yearitem.startTime" time-validate="year"  name="startTime" end-time="yearitem.endTime" max="2050" required>
            <div ng-messages="myform.startTime.$error">
              <div ng-message="required">查询年份必填</div>
              <div ng-message="time-error">{{errorInfo.startTime[0]}}</div>
              <div ng-message="too-great">{{errorInfo.startTime[1]}}</div>
            </div>
        </md-input-container>
      </div>

      <div   ng-switch-default='5'>
         <md-input-container flex>
            <label >结束时间</label>
            <input type="number" ng-model="yearitem.endTime" time-validate="year"   required  start-time='yearitem.startTime'  name="startTimes">
            <div ng-messages="myform.startTimes.$error">
              <div ng-message="required">查询年份必填</div>
              <div ng-message="time-error">{{errorInfo.endTime[0]}}</div>
              <div ng-message="too-great">{{errorInfo.endTime[1]}}</div>
            </div>
        </md-input-container>
      </div>

      <!--账期为月-->
      <div  ng-switch-when='3'>
         <md-input-container flex>
          <label>开始时间</label>
          <input type="month" ng-model="yearitem.startTime"  time-validate="month"  end-time='yearitem.endTime' name='startTime' required >
           <div ng-messages="myform.startTime.$error">
              <div ng-message="required">查询年份必填</div>
              <div ng-message="time-error">{{errorInfo.startTime[0]}}</div>
              <div ng-message="too-great">{{errorInfo.startTime[1]}}</div>
           </div>
        </md-input-container>
      </div>

      <div  ng-switch-when='3'>
        <md-input-container flex>
          <label>结束时间</label>
          <input type="month" ng-model="yearitem.endTime"  time-validate="month" start-time='yearitem.startTime' name='endTime'  required >
        <div ng-messages="myform.endTime.$error">
          <div ng-message="required">查询年份必填</div>
          <div ng-message="time-error">{{errorInfo.endTime[0]}}</div>
          <div ng-message="too-great">{{errorInfo.endTime[1]}}</div>
        </div>
        </md-input-container>
      </div>

      <!--账期为日-->
      <div  ng-switch-when='1'>
         <md-input-container flex>
          <label>开始时间</label>
          <input type="date" ng-model="yearitem.startTime"   time-validate="day"   name='startTime' end-time='yearitem.endTime' required >
          <div ng-messages="myform.startTime.$error">
           <div ng-message="date">请正确输入时间</div>
           <div ng-message="time-error">{{errorInfo.startTime[0]}}</div>
           <div ng-message="too-great">{{errorInfo.startTime[1]}}</div>
          </div>
         </md-input-container>
      </div>

      <div  ng-switch-when='1'>
         <md-input-container flex>
          <label>结束时间</label>
          <input type="date" ng-model="yearitem.endTime"   time-validate="day"    name='startTimes' required  start-time='yearitem.startTime'>
          <div ng-messages="myform.startTimes.$error">
           <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">{{errorInfo.endTime[0]}}</div>
            <div ng-message="too-great">{{errorInfo.endTime[1]}}</div>
          </div>
         </md-input-container>
      </div>


    <input-quarter-group ng-switch-when='4' start-time='yearitem.startTime' end-time='yearitem.endTime'></input-quarter-group>
    </div>
    <i class="glyphicon glyphicon-chevron-up shrinkage" ng-click="shoumun=0"  ng-show='flex && myform.$invalid!==true'></i>
    <md-button ng-click="dropDrowSw()"  class="md-fab md-primary md-hue-1" aria-label="Profile" ng-disabled='myform.$invalid'>
      <i class="glyphicon glyphicon-search" ng-show="shoumun==1" ></i>
      <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;"  ng-show="shoumun==0" ></i>
    </md-button>
  </div>
</form>


<div class="table-info" ng-controller='failedTradeTable'>
  <div class="menus" ng-show='pageSW'>
     <form action="{{excelExport}}"  target="_black"  method="post">
      <input type='hidden' name="data"  value='{{ExportList}}'>
      <md-button  type="submit"  class="md-raised">导出Excel</md-button>
    </form>
  </div>
   <div class="table-detail"  style="text-align:center;" ng-show='pageSW' >
        <h3 style="margin-top:0;font-size:large;font-weight:bold;color:black"> {{seriesstateName}} </h3>
      <div class="t_r">
        <table class="table table-bordered">
          <thead>
            <tr>
              <th>账期</th>
              <th>业务线</th>
              <th>省公司</th>
              <th >交易类型</th>
              <th>返回码</th>
              <th>错误描述</th>
              <th ng-show='collectSw'>机构</th>
              <th ng-show='collectSw'>接入渠道</th>
              <th>失败笔数(笔)</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat='item in itemss.sumData.FailedDeals'>
              <td>{{item.time}}</td>
              <td class="table-ellipsis" title='{{item.businessLineName}}'>{{item.businessLineName}}</td>
              <td class="table-ellipsis" title='{{item.provinceName}}'>{{item.provinceName}}</td>
              <td class="table-ellipsis" title='{{item.tradeTypeName}}' >{{item.tradeTypeName}}</td>
              <td class="table-ellipsis">{{item.returnCode}}</td>
              <td class="table-ellipsis" title='{{item.returnName}}'>{{item.returnName}}</td>
              <td class="table-ellipsis" title='{{item.organiztionName}}' ng-show='collectSw'>{{item.organiztionName}}</td>
              <td class="table-ellipsis" title='{{item.channelName}}' ng-show='collectSw'>{{item.channelName}}</td>
              <td class="table-ellipsis">{{item.failNum}}</td>
            </tr>
            <tr class='summary'>
             <!--  <th colspan="7" ng-show='collectSw'>汇总</th>
             <th ng-show='!collectSw' colspan="5">汇总</th> -->
              <th>汇总</th>
              <th></th>
              <th></th>
              <th></th>
              <th ></th>
              <th ng-show='collectSw'></th>
              <th ng-show='collectSw'></th>
               <th></th>
              <th >{{sumSumData}}</th>
            </tr>
          </tbody>
        </table>
      </div >
      <div  >
         <ds-page
           total-count=totalCounts
           page-size=pageparam.page.pageSize
           page-itmes=pageItmes
           param=pageparam
           current-page=pageparam.page.currentPage
           go-page="sumturnToPage(pageparam)"
           page-size-change="pageSizeChange(pageparam.page.pageSize)"
           show-max-page="5"
           first-text="<<"
           last-text=">>"
           previous-text="<"
           next-text=">"
           >
         </ds-page>
      </div>
  </div>
</div>

